#include"TcpServer.hpp"
#include<memory>
#include"Calculator.hpp"
#include"Parse.hpp"
#include "Protocol.hpp"
#include"Daemon.hpp"


int main()
{
    ENABLE_FILE_LOG();

    Daemon(false ,false);
    //应用层
    Calculator cal;

    Parse pas([&cal](const Request &req)
    {return cal.Execute(req);});

    std::unique_ptr<TcpServer> ts_ptr = std::make_unique<TcpServer>([&pas](std::string &package)
                                                                    {return pas.Entry(package);});

    ts_ptr->InitServer();
    ts_ptr->Start();
    
    return 0;
}